#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;

class Solution {
public:
    vector<int> getRow(int rowIndex) {
        vector<int> result = {1};
        int index = 0;
        while(index<rowIndex){
            int size = result.size();
            for(int i = 0;i<size;++i){
                if(i==0){
                    continue;
                }
                else {
                    result.push_back(result[0]+result[1]);
                    result.erase(result.begin());
                }
            }
            result.push_back(1);
            ++index;
        }
        return result;
    }
};

int main(){
    Solution S;
    vector<int> result = S.getRow(4);
    return 0;
}